package com.ruoyi.order.domain;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 订单主表对象 order
 *
 * @author 林道敬
 * @date 2025-01-04
 */
@TableName(value ="product_order")
@Data
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /** 订单唯一标识 */
    @Excel(name = "订单唯一标识")
    private String outTradeNo;

    /** NEW 未支付订单,PAY已经支付订单,CANCEL超时取消订单 */
    @Excel(name = "NEW 未支付订单,PAY已经支付订单,CANCEL超时取消订单")
    private String state;

    /** 订单总金额 */
    @Excel(name = "订单总金额")
    private BigDecimal totalAmount;

    /** 订单实际支付价格 */
    @Excel(name = "订单实际支付价格")
    private BigDecimal payAmount;

    /** 支付类型，微信-银行-支付宝 */
    @Excel(name = "支付类型，微信-银行-支付宝")
    private String payType;

    /** 昵称 */
    @Excel(name = "昵称")
    private String nickname;

    /** 头像 */
    @Excel(name = "头像")
    private String headImg;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 0表示未删除，1表示已经删除 */
    @Excel(name = "0表示未删除，1表示已经删除")
    private Long del;

    /** 订单类型 DAILY普通单，PROMOTION促销订单 */
    @Excel(name = "订单类型 DAILY普通单，PROMOTION促销订单")
    private String orderType;

    /** 收货地址 json存储 */
    @Excel(name = "收货地址 json存储")
    private String receiverAddress;

    /** 总重量 */
    @Excel(name = "总重量")
    private BigDecimal totalWeight;

    /** 运费 */
    @Excel(name = "运费")
    private BigDecimal payFee;
    /** 订单子表信息 */
    @TableField(exist = false)
    private List<ProductOrderItem> productOrderItemList;

    public BigDecimal getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(BigDecimal totalWeight) {
        this.totalWeight = totalWeight;
    }

    public BigDecimal getPayFee() {
        return payFee;
    }

    public void setPayFee(BigDecimal payFee) {
        this.payFee = payFee;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setOutTradeNo(String outTradeNo)
    {
        this.outTradeNo = outTradeNo;
    }

    public String getOutTradeNo()
    {
        return outTradeNo;
    }
    public void setState(String state)
    {
        this.state = state;
    }

    public String getState()
    {
        return state;
    }
    public void setTotalAmount(BigDecimal totalAmount)
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount()
    {
        return totalAmount;
    }
    public void setPayAmount(BigDecimal payAmount)
    {
        this.payAmount = payAmount;
    }

    public BigDecimal getPayAmount()
    {
        return payAmount;
    }
    public void setPayType(String payType)
    {
        this.payType = payType;
    }

    public String getPayType()
    {
        return payType;
    }
    public void setNickname(String nickname)
    {
        this.nickname = nickname;
    }

    public String getNickname()
    {
        return nickname;
    }
    public void setHeadImg(String headImg)
    {
        this.headImg = headImg;
    }

    public String getHeadImg()
    {
        return headImg;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setDel(Long del)
    {
        this.del = del;
    }

    public Long getDel()
    {
        return del;
    }
    public void setOrderType(String orderType)
    {
        this.orderType = orderType;
    }

    public String getOrderType()
    {
        return orderType;
    }
    public void setReceiverAddress(String receiverAddress)
    {
        this.receiverAddress = receiverAddress;
    }

    public String getReceiverAddress()
    {
        return receiverAddress;
    }

    public List<ProductOrderItem> getProductOrderItemList() {
        return productOrderItemList;
    }

    public void setProductOrderItemList(List<ProductOrderItem> productOrderItemList) {
        this.productOrderItemList = productOrderItemList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("outTradeNo", getOutTradeNo())
            .append("state", getState())
            .append("createTime", getCreateTime())
            .append("totalAmount", getTotalAmount())
            .append("payAmount", getPayAmount())
            .append("payType", getPayType())
            .append("nickname", getNickname())
            .append("headImg", getHeadImg())
            .append("userId", getUserId())
            .append("del", getDel())
            .append("updateTime", getUpdateTime())
            .append("orderType", getOrderType())
            .append("receiverAddress", getReceiverAddress())
            .toString();
    }
}
